package com.lan.springbootdruid.service.impl;

import com.lan.springbootdruid.entity.City;
import com.lan.springbootdruid.mapper.CityMapper;
import com.lan.springbootdruid.service.CityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author: Lan
 * @date: 2019/5/6 11:32
 * @description:
 */
@Service
public class CityServiceImpl implements CityService {

    @Autowired
    private CityMapper cityMapper;

    @Override
    public City getCityById(int id) {
        return cityMapper.getCityById(id);
    }

    @Override
    @Transactional(rollbackFor = Exception.class)
    public int updateCityName(int id) {
        int i = cityMapper.updateCityName(id);
        return i;
    }
}
